package com.y.fund.domain.com;

import org.hibernate.annotations.GenericGenerator;

import com.y.fund.aacore.abs.IdObj;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name="co02_file")
@GenericGenerator(name="assignGenerator", strategy="assigned")
@Schema(title="FileInfo")
public class CO02FileInfo extends IdObj{

	@Size(max=64)
	@Column(name="biz_id", length=64)
	@Schema(title = "文件所属业务对象ID【64位】")
	private String bizId;

	@Size(max=64)
	@Column(name="uploader_id", updatable = false, length=64)
	@Schema(title = "文件上传者ID【64位】")
	private String uploaderId;
	
	@Size(max=128)
	@Column(name="uploader_name", length=128)
	@Schema(title = "文件上传者姓名【128位】")
	private String uploaderName;

	@Size(max=512)
	@Column(name="rel_path", length=400)
	@Schema(title = "文件在服务器存储的相对路径【400位长度】")
	private String relPath;

	@Size(max=256)
	@Column(name="f_name", length=256)
	@Schema(title = "原始文件名称【256 位】")
	private String name;

	@Size(max = 32)
	@Column(name = "biz_flag", length = 64)
	@Schema(title = "用于区分所属同一业务ID的不同功能模块的文件 [64位]")
	private String bizFlag;

	@Size(max = 128)
	@Column(name = "biz_tag", length = 128)
	@Schema(title = "自定义的文件业务标签【128位】")
	private String bizTag;

	@Size(max = 64)
	@Column(name = "cate_id", length = 64)
	@Schema(title = "文档分类ID【64位】")
	private String cateId;
	
	@Size(max=64)
	@Column(name="data_id", length=64)
	@Schema(title = "文件所属业务对象再关联的另一个业务数据ID，可为空，如个人资料再关联生产号【64位】")
	private String dataId;

	@Size(max=32)
	@Column(name="f_type", length=32)
	@Schema(title = "文件类型，一般用文件后缀区分[如.zip .docx .pdf][32位] ")
	private String type;

	@Column(name="f_url", length=512)
	@Schema(title = "文件访问地址，url【512位】")
	private String url;

	@Column(name="f_size", length=16)
	@Schema(title = "文件大小，单位：字节")
	private Long size;
	
	public CO02FileInfo() {
		super();
	}

	public CO02FileInfo(String bizId, String bizFlag) {
		super();
		this.bizId = bizId;
		this.bizFlag =  bizFlag;
	}
}
